package com.drojian.demo1.root_fragment;

import android.content.Intent;
import android.os.Bundle;

import androidx.fragment.app.Fragment;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;

import com.drojian.demo.R;
import com.drojian.demo1.test3.ConstraintLayoutActivity;
import com.drojian.demo1.test3.CoordinatorLayoutMainActivity;
import com.drojian.demo1.test3.FrameLayoutActivity;
import com.drojian.demo1.test3.LinearLayoutActivity;
import com.drojian.demo1.test3.RelativeLayoutActivity;


public class RootFragment3 extends Fragment {


    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.ui1_fragment_root3, container, false);

        Button linearLayout1 = view.findViewById(R.id.LinearLayout1);
        Button relativeLayout1 = view.findViewById(R.id.RelativeLayout1);
        Button frameLayout1 = view.findViewById(R.id.FrameLayout1);
        Button constraintLayout1 = view.findViewById(R.id.ConstraintLayout1);
        Button coordinatorLayout1 = view.findViewById(R.id.CoordinatorLayout1);

        linearLayout1.setOnClickListener(v -> startActivity(new Intent(getContext(), LinearLayoutActivity.class)));
        relativeLayout1.setOnClickListener(v -> startActivity(new Intent(getContext(), RelativeLayoutActivity.class)));
        frameLayout1.setOnClickListener(v -> startActivity(new Intent(getContext(), FrameLayoutActivity.class)));
        constraintLayout1.setOnClickListener(v -> startActivity(new Intent(getContext(), ConstraintLayoutActivity.class)));
        coordinatorLayout1.setOnClickListener(v -> startActivity(new Intent(getContext(), CoordinatorLayoutMainActivity.class)));
        return view;
    }
    public static RootFragment3 newInstance() {
        return new RootFragment3();
    }
}